package edu.pku.sei.transformation.editor.views.figures;

import org.eclipse.draw2d.Ellipse;
import org.eclipse.draw2d.Figure;
import org.eclipse.draw2d.Label;
import org.eclipse.draw2d.XYLayout;
import org.eclipse.draw2d.geometry.Point;
import org.eclipse.draw2d.geometry.Rectangle;


public class CheckPointFigure extends Figure{
	private Label tag = new Label("<<Check Point>>");
	private Ellipse body = new Ellipse();
	private static final int TAG_HEIGHT = 10;
	private static final int BODY_SIZE = 20;
	public CheckPointFigure() {
		this.setLayoutManager(new XYLayout());
		this.add(tag);
		this.add(body);
	}
	
	@Override
	public void setBounds(Rectangle rect) {
		// TODO Auto-generated method stub
		super.setBounds(rect);
		tag.setFont(FontConstant.STEREO_TYPE_LABEL);
		body.setLocation(new Point(rect.x+(rect.width-BODY_SIZE)/2, rect.y));
		body.setSize(BODY_SIZE, BODY_SIZE);
		
		tag.setLocation(new Point(rect.x, rect.y+BODY_SIZE));
		tag.setSize(rect.width, TAG_HEIGHT);
		
	}
	
	public Figure getBody() {
		return this.body;
	}
}
